package com.glorystone.ins.controller;

import com.glorystone.ins.domain.Member;
import com.glorystone.ins.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 渠道人员控制类
 * Created by wangwei on 2018/3/28.
 */
@Controller
@RequestMapping("/member")
public class MemberController extends BaseController {

    @Autowired
    private MemberService memberService;

    @ResponseBody
    @RequestMapping(value = "/{channelId}", method = RequestMethod.GET)
    public ResponseEntity<List<Member>> findByChannelId(@PathVariable("channelId") Long channelId) {

        List<Member> list = memberService.findByChannleId(channelId);
        return new ResponseEntity<>(list, HttpStatus.OK);

    }


}
